﻿using System.Collections.Generic;
using PerceptiveMCAPI.Types;
//
namespace PerceptiveMCAPI
{
   internal static partial class ValidateInput
   {
      // campaigns
      internal static List<Api_ValidatorMessage> Validate( campaignsInput input )
      {
         List<Api_ValidatorMessage> messages = ValidateBaseParameters( input as Api_BaseInput );
         Api_ValidatorMessage val;
         //-----------------------
         // apikey
         val = Validator.apikey_valid( input.parms.apikey );
         if ( val != null ) messages.Add( val );
         // start
         val = Validator.start_valid( input.parms.start );
         if ( val != null ) messages.Add( val );
         // limit
         val = Validator.limit_valid( input.parms.limit, MCAPISettings.max_campaigns );
         if ( val != null ) messages.Add( val );

         // filters, none are required 
         if ( input.parms.filters.Count > 0 )
         {
            List<Api_ValidatorMessage> val_list = campaigns_Validator.filters_valid( input.parms.filters );
            foreach ( Api_ValidatorMessage msg in val_list )
            {
               messages.Add( msg );
            }
         }
         //--------------------
         return messages;
      }
   }
}
